<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>${subscription.prefix} feeds</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>

<body>
<a name="start"></a>
<g:set var="feeds" value="${subscription.nonEmptyFeeds}"/>

<h1>${subscription.prefix} feeds</h1>
<a href="#item-1-1">Go straight to first item</a>
<br/>

<a name="toc"></a>

<h2>Feeds:</h2>
<ol>
    <g:each in="${feeds}" var="feed" status="feedNr">
        <li><a href="#feed-${feedNr}">${feed.shortName}</a> ${feed.newEntries.size()}</li>
    </g:each>
</ol>
<br/>
<g:each in="${feeds}" var="feed" status="feedNr">

    <a name="feed-${feedNr}"></a>

    <div>
        <g:if test="${feedNr > 1}">
            <a href="#feed-${feedNr - 1}">Prev</a>
        </g:if>

        <g:if test="${feedNr < feeds.size()}">
            <a href="#feed-${feedNr + 1}">Next</a>
        </g:if>
        <a href="#toc">TOC</a>
        ${feedNr}/${feeds.size()}
    </div>


    <h3><a href="#feed-content-${feedNr}">${feed.shortName}</a></h3>
    <ol>
        <g:each in="${feed.newEntries}" var="entry" status="entryNr">
            <li><a href="#item-${feedNr}-${entryNr}">${entry.title}</a>
            </li>
        </g:each>
    </ol>
</g:each>
<br/>

<g:each in="${feeds}" var="feed" status="feedNr">
    <a name="feed-content-${feedNr}"></a>

    <h2>${feed.shortName}</h2>
    <g:each in="${feed.newEntries}" var="entry" status="entryNr">
        <a name="#item-${feedNr}-${entryNr}"></a>

        <div>
            <g:if test="${entryNr < feed.newEntries.size()}">
                <a href="#item-${feedNr}-${entryNr + 1}">Next</a>
            </g:if>

            <a href="#feed-${feedNr}">${feed.shortName}</a>
            <a href="#toc">TOC</a>

            ${entryNr}/${feed.newEntries.size()}
        </div>

        <h3><a href="${entry.link}">${entry.title}</a> ${entry.publishedDate.format("MMM dd")}</h3>

        <div style="text-align:right">
            ${entry.author}
        </div>

        <div>
            ${entry.description}
        </div>

        <br/>
    </g:each>
</g:each>
</body>
</html>
